package com.ndphu.comic.gui.fragment.customview;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

public class AllowChildSlidingPager extends ViewPager {
	private boolean enabled;
	
	public AllowChildSlidingPager(Context context) {
		super(context);
	}
	
	public AllowChildSlidingPager(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	@Override
	public boolean onInterceptTouchEvent(MotionEvent event) {
		if (this.enabled) {
            return super.onInterceptTouchEvent(event);
        }
		return false;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}
}